home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
C++
/
Applications
/
PICSee Dust 1.01
/
Preferences source
/
PICS_CreatorPane.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1995-11-16
|
4KB
|
111 lines
#include "PICS_PreferencesPanes.h"
#include "PICS_Types.h"
#include "OSTypes.h"
enum {
// Creator pane
kCreatorPane_PhotoShopCreatorRadio = kPrefsDlog_LastItem,
kCreatorPane_ColorItCreatorRadio,
kCreatorPane_OtherCreatorRadio,
kCreatorPane_GetAppCreatorRadio,
kCreatorPane_AppCreatorText,
kCreatorPane_LineSeparator,
kCreatorPane_Box
};
// ---------------------------------------------------------------------------
void PrefsDialogSetupCreatorPane(DialogPtr prefsDlog) {
// PICT creator types
if ((**sPrefsData->prefs).pictCreatorType == kPhotoShopCreatorType) {
SelectRadioBtn(prefsDlog, kCreatorPane_PhotoShopCreatorRadio,
kCreatorPane_PhotoShopCreatorRadio,
kCreatorPane_OtherCreatorRadio);
}
else if ((**sPrefsData->prefs).pictCreatorType == kColorItCreatorType) {
SelectRadioBtn(prefsDlog, kCreatorPane_ColorItCreatorRadio,
kCreatorPane_PhotoShopCreatorRadio,
kCreatorPane_OtherCreatorRadio);
}
else {
SelectRadioBtn(prefsDlog, kCreatorPane_OtherCreatorRadio,
kCreatorPane_PhotoShopCreatorRadio,
kCreatorPane_OtherCreatorRadio);
}
Str15 creatorStr;
creatorStr[0] = 4;
BlockMove(&(**sPrefsData->prefs).pictCreatorType, &creatorStr[1], sizeof(OSType));
SetDItemText(prefsDlog, kCreatorPane_AppCreatorText, creatorStr);
} // END PrefsDialogSetupCreatorPane
// ---------------------------------------------------------------------------
Boolean PrefsDialogGetCreatorPaneSettings(DialogPtr prefsDlog) {
// Get PICT creator type
if (GetDlogCtlValue(prefsDlog, kCreatorPane_PhotoShopCreatorRadio)) {
(**sPrefsData->prefs).pictCreatorType = kPhotoShopCreatorType;
}
else if (GetDlogCtlValue(prefsDlog, kCreatorPane_ColorItCreatorRadio)) {
(**sPrefsData->prefs).pictCreatorType = kColorItCreatorType;
}
else {
Str15 osStr;
GetDialogItemText(GetDItemHdl(prefsDlog, kCreatorPane_AppCreatorText), osStr);
StringToOSType(osStr, &(**sPrefsData->prefs).pictCreatorType);
}
return(true);
} // END PrefsDialogGetCreatorPaneSettings
// ---------------------------------------------------------------------------
void PrefsDialogCreatorPaneHit(DialogPtr prefsDlog, short itemHit) {
switch(itemHit) {
case kCreatorPane_PhotoShopCreatorRadio:
case kCreatorPane_ColorItCreatorRadio:
case kCreatorPane_OtherCreatorRadio:
SelectRadioBtn(prefsDlog, itemHit,
kCreatorPane_PhotoShopCreatorRadio, kCreatorPane_OtherCreatorRadio);
break;
case kCreatorPane_GetAppCreatorRadio:
OSType creatorType;
if (GetAppCreatorType(&creatorType)) {
Str15 osStr;
OSTypeToString(creatorType, osStr);
SetDItemText(prefsDlog, kCreatorPane_AppCreatorText, osStr);
SelectRadioBtn(prefsDlog, kCreatorPane_OtherCreatorRadio,
kCreatorPane_PhotoShopCreatorRadio,
kCreatorPane_OtherCreatorRadio);
}
break;
}
} // END PrefsDialogCreatorPaneHit
// ---------------------------------------------------------------------------
void PrefsDialogCreatorPaneUpdate(DialogPtr prefsDlog, EventRecord *theEvt, Boolean frontMost) {
Rect lineRect;
GetDItemRect(prefsDlog, kCreatorPane_Box, &lineRect);
GrayDrawShadowBox(&lineRect, NULL);
GetDItemRect(prefsDlog, kCreatorPane_LineSeparator, &lineRect);
GrayDrawShadowLine(&lineRect, NULL);
} // END PrefsDialogCreatorPaneUpdate
// ---------------------------------------------------------------------------
void PrefsDialogCreatorPaneActivate(DialogPtr prefsDlog, Boolean activate) {
short hiliteMode = activate ? 0 : 255;
for (short i = kCreatorPane_PhotoShopCreatorRadio;
i <= kCreatorPane_GetAppCreatorRadio; i++) {
HiliteControl((ControlHandle)GetDItemHdl(prefsDlog, i), hiliteMode);
}
} // END PrefsDialogCreatorPaneActivate